package com.itheima.GuessNumber;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Random;

import static java.lang.Integer.parseInt;

public class GuessNumberUtils {
    public static void main(String[] args) throws IOException {

        startGuess();

    }

    private static void startGuess() throws IOException {
        Random num=new Random();
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int i = num.nextInt(100);
        while(true) {
            String s = br.readLine();

            try {
                int i1 = parseInt(s);
                if (i < i1) {
                    System.out.println("数据大了");
                } else if (i > i1) {
                    System.out.println("数据小了");
                } else if (i == i1) {
                    System.out.println("答对了");
                    break;
                }
            } catch (NumberFormatException e) {
                System.out.println("请输入1-100的整数");
            }
        }
    }
}
